<div class="login-all">
  <form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
    <div>
      <h1 class="login-all-title">{{system.systemName}}</h1>
    </div>
    <nz-form-item>
      <nz-form-control [nzErrorTip]="accountTpl">
        <nz-input-group nzPrefixIcon="user">
          <input type="text" nz-input formControlName="account"
                 placeholder="请输入邮箱"
                 (blur)="verifyAccount()"
                 (keydown)="keydown()"
          />
          <ng-template #accountTpl let-control>
            <ng-container *ngIf="control.hasError('required')||control.hasError('email')">
              你输入的电子邮箱格式不正确!
            </ng-container>
            <ng-container *ngIf="control.hasError('confirm')">
              你输入的账号不存在！
            </ng-container>
          </ng-template>
        </nz-input-group>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-control nzErrorTip="密码不能为空,不能小于6位！">
        <nz-input-group nzPrefixIcon="lock">
          <input type="password" nz-input formControlName="password" placeholder="请输入密码"/>
        </nz-input-group>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item *ngIf="openVerifyCode">
      <nz-form-control nzErrorTip="验证码不能为空！">
        <nz-input-group nzPrefixIcon="safety-certificate" class="login-verify-code">
          <input class="input" type="text" nz-input formControlName="verifyCode"
                 placeholder="验证码"/>
          <img class="img" [src]="verifyCodeInfo.imgUrl" *ngIf="verifyCodeInfo.imgUrl"
               (click)="openVerifyCode?verifyCode():''">
        </nz-input-group>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-control>
        <label nz-checkbox formControlName="remember">
          <span>记住密码</span>
        </label>
        <a class="login-form-forgot" class="login-form-forgot"
           [routerLink]="'/forget'">找回密码</a>
        <button nz-button class="login-form-button" [nzType]="'primary'">登录</button>
        <a [routerLink]="'/register'">注册新用户</a>
      </nz-form-control>
    </nz-form-item>
  </form>
  <div class="login-footer">
    有疑问请联系：<a target="_blank" href="{{systemInfoMap['CONTACT_MAILBOX_URL']}}"
               style="text-decoration:none;">{{systemInfoMap['CONTACT_MAILBOX']}}</a><br/>
    Copyright © Rivamed Corporation, All Rights Reserved {{systemInfoMap['SYSTEM_VERSION']}}
  </div>
</div>
